package com.example.thirdhomework

import android.annotation.SuppressLint
import android.content.Intent.getIntent
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.thirdhomework.databinding.ActivityFirstBinding
import com.example.thirdhomework.databinding.ActivitySecondBinding

class SecondActivity : AppCompatActivity() {
    private val binding by lazy{
        ActivitySecondBinding.inflate(layoutInflater)
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(binding.root)
        ViewCompat.setOnApplyWindowInsetsListener(binding.main) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }


        binding.button4.setOnClickListener{
            val intent=getIntent()
            intent.putExtra("KEY1",binding.editText3.text.toString())
            setResult(1,intent)
            finish()
        }
    }
}